How to implement printf without any standard libraries, from parsing the format string, passing variadic arguments to formatting numbers and implementing x86 division. Links: - Discord channel: https://discord.gg/RgHc5XrCEw - Source code: https://github.com/chibicitiberiu/nanobyte_os/releases/tag/Part5 - Cdecl explanation: https://youtu.be/F3XiH78erNM?t=1615 Tools: - Open Watcom 2: https://github.com/open-watcom/open-watcom-v2 Documentation: - OpenWatcom manuals (in installation directory) - Calling conventions: https://en.wikipedia.org/wiki/X86_calling_conventions - Ralf Brown's Interrupt List: http://www.ctyme.com/rbrown.htm - Intel manuals: https://software.intel.com/content/www/us/en/develop/articles/intel-sdm.html#combined - Complex 64-bit division implementation: https://github.com/open-watcom/open-watcom-v2/blob/master/bld/clib/cgsupp/a/i8d086.asm Chapters: 0:00 Introduction 0:38 The plan 1:44 Passing varargs 7:07 Parsing the format string 12:35 Implementation 20:36 Division issues 23:41 Long division 25:25 Implementation of long division 28:55 Conclusion